#ifndef _ADCJ_H_
#define _ADCJ_H_

#define FILTER_N  	9				/*滤波计算数量*/
#define ReMove  	3				/*滤波计算去掉数量*/
#define ReMove_Sun  (ReMove+ReMove)	/*滤波计算去掉数量和*/

struct FILTER_REG
{
    unsigned char  JS;				/*数据变化缓慢次数*/
	unsigned char  DValue;			/*变化差值*/
			 short buf[FILTER_N];	/*滤波计算缓冲区*/
};
extern struct FILTER_REG FR[11];

short FILTER(unsigned char ch,short data);

void MV_TC(unsigned char ucCH);    /*mV电压转热电偶温度*/
void MV_R(unsigned char ucCH);     /*mV电压转铂电阻温度*/
void MV_RC100(unsigned char ucCH);
void MV_V(unsigned char ucCH);
void MV_mA(unsigned char ucCH);
void PT_V(unsigned char ucCH); 		/*铂电阻断线检测*/
	
void ADCJ(void);

#define CH_ALLOFF {CH0(1);CH1(1);CH2(1);CH3(1);CH4(1);CH5(1);CH6(1);CH7(1);CH8(1);CH9(1);} //�ر�ͨ��ѡ��

#define CH_ON(CH)   switch(CH) {\
    case 0: CH0(0);  break;\
    case 1: CH1(0);  break;\
    case 2: CH2(0);  break;\
    case 3: CH3(0);  break;\
    case 4: CH4(0);  break;\
    case 5: CH5(0);  break;\
    case 6: CH6(0);  break;\
    case 7: CH7(0);  break;\
    case 8: CH8(0);  break;\
    case 9: CH9(0);  break;\
}\

#endif
